<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%><%@page import="java.util.Map"%>

<%@ include file="../common/commonJS.jsp" %>
<%@ include file="../common/commonLabel.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>客户信息列表</title>
</head>
<script type="text/javascript">
function del(cid){
	if(confirm("确定删除该客户吗？")){
		window.location.href="<%=request.getContextPath()%>/clientDel.action?cid="+cid;
	}
	
}

function upd(cid){
	window.location.href="<%=request.getContextPath()%>/clientUpdSel.action?cid="+cid;
}
</script>
<body>
<table width="760" border="0" cellpadding="0" cellspacing="0" >
  <tr>
     <td>
     <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="MainBody">
      <tr>
        <td class="MainBody_title"><hello:forValue type="title" /></td>
      </tr>
      <tr>
        <td valign="top" >
        <div align="right" style="padding: 10 50 10 0;">
       <input name="toIns" value="添加" type="button" class="btn" onclick="location.href='<%=request.getContextPath()%>/docs/ys_clientorder/client_ins.jsp'"/>
        </div>
        <table border="0" cellpadding="0" cellspacing="0"  class="MainBody_table">
           <tr>
				<th nowrap="nowrap">序号</th>
				<th nowrap="nowrap">客户名称</th>
				<th nowrap="nowrap">移动电话</th>
				<th nowrap="nowrap">固定电话</th>
				<th nowrap="nowrap">单位名称</th>
				<th nowrap="nowrap">客户类别</th>
				<th nowrap="nowrap">操作</th>
			</tr>

             	<% 
             	if(request.getAttribute("list")!=null&&!((List)request.getAttribute("list")).isEmpty()){
             		List list = (List)request.getAttribute("list");
             		for(int i=0;i<list.size();i++){
             			Map c = (Map)list.get(i);
             			request.setAttribute("c",c);
             	 %>
			<tr>
				<td align="center" nowrap="nowrap"><%=i+1 %></td>
				<td align="center" nowrap="nowrap"><a href="<%=request.getContextPath()%>/clientSel.action?cid=<%=c.get("clientId") %>" title="客户详细信息"><%=c.get("clientName") %></a></td>
				<td align="center" nowrap="nowrap"><%=c.get("phone") %></td>
				<td align="center" nowrap="nowrap"><%=c.get("tel") %></td>
				<td align="center" nowrap="nowrap"><%=c.get("unitName") %></td>
				<td align="center" nowrap="nowrap"><%=c.get("clientType") %></td>
				<td align="center" nowrap="nowrap">
				<a href="#" title="修改客户信息" onclick = "return upd('<%=c.get("clientId")%>')">[修改]</a>
				<a href="#" title="删除该客户" onclick = "return del('<%=c.get("clientId") %>');">[删除]</a>
				</td> 
			</tr>
			<%}//for end
             }else{%>
		<tr>
			<td align="center" colspan="6">暂时没有您可以浏览的数据</td>
		</tr>
			<%
				} %>
          </table>
          <table border="0" cellpadding="0" cellspacing="0" class="MainBody_fun">
            <tr>
              <td>
               <hello:AllPage />
			  </td>
            </tr>
          </table>
          </td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>